import LinearGradient from 'react-native-linear-gradient';
import ShimmerPlaceHolder from 'react-native-shimmer-placeholder';
import FastImage, { type FastImageProps } from 'react-native-fast-image';
import { useState } from 'react';
export default ({style, className, onLoadEnd, ...rest}: FastImageProps) => {
  const [isLoaded, setIsLoaded] = useState(false);
  return (
    <ShimmerPlaceHolder
      style={style}
      className={className}
      LinearGradient={LinearGradient}
      visible={isLoaded}>
      <FastImage
        {...rest}
        className={className}
        style={style}
        onLoadEnd={() => {
          setIsLoaded(true);
          onLoadEnd?.();
        }}
      />
    </ShimmerPlaceHolder>
  );
};
